import 'dart:convert';

import 'package:enterprise_v6_app/app/data/common/choice_bean.dart';
import 'package:enterprise_v6_app/generated/json/base/json_field.dart';
import 'package:enterprise_v6_app/generated/json/department_user_entity.g.dart';
export 'package:enterprise_v6_app/generated/json/department_user_entity.g.dart';

/// 部门下人员
@JsonSerializable()
class DepartmentUserEntity  extends ChoiceBean{
  DepartmentUserEntity();

  factory DepartmentUserEntity.fromJson(Map<String, dynamic> json) => $DepartmentUserEntityFromJson(json);

  ///	企业编码（类型为企业人员的才会有值）
  String? companyCode = '';

  ///	1默认权限 2自定义
  String? defaultStatus = '';

  ///	部门ID集合：字符串
  String? departmentIds = '';

  ///	部门名称
  String? departmentName = '';

  ///
  List<dynamic>? dids = [];

  ///	学历
  String? education = '';

  ///	uuid
  String? id = '';

  ///	联系电话
  String? mobile = '';

  ///	昵称/姓名
  String? nickname = '';

  ///	性别: 0.男 1.女 2.保密
  int? sex = 0;

  ///	用户名
  String? username = '';

  /// 是否选中
  bool? isSelected = false;

  Map<String, dynamic> toJson() => $DepartmentUserEntityToJson(this);

  @override
  String toString() {
    return jsonEncode(this);
  }

  @override
  String getId() {
    return id ?? '';
  }

  @override
  bool getIsChecked() {
    return isSelected ?? false;
  }

  @override
  String getShowName() {
    return nickname ?? '空';
  }

  @override
  setIsChecked(bool isChecked) {
    isSelected = isChecked;
  }
}
